package com.own.business.exam.entity.bo;


import com.own.business.exam.entity.po.ExamRuleAccount;
import com.own.component.common.base.entity.BaseBo;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * ExamRuleAccountBo
 *
 * @author chenxueli
 * @date 2021/05/18 14:43:47
 */
@Schema(title = "考试规则指定账号表" + ConstantBeanSuffix.BO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class ExamRuleAccountBo extends BaseBo<ExamRuleAccount> {

    @Schema(title = "规则id")
    private Long ruleId;

    @Schema(title = "试卷名称")
    private String account;

    /**
     * 转持久化对象
     *
     * @param entity 原持久化对象
     * @return 持久化对象
     */
    @Override
    public ExamRuleAccount toPo(ExamRuleAccount entity) {
        if (entity == null) {
            entity = new ExamRuleAccount();
        }
        entity.setFkRuleId(ruleId);
        entity.setAccount(account);
        return super.toPo(entity);
    }

}
